package seatiger.tomcat.catalina;

/**
 * 日记记录logger接口
 */
public interface Logger {

    String FATAL_STR = "FATAL";
    String ERROR_STR = "ERROR";
    String WARNING_STR = "WARNING";
    String INFORMATION_STR = "INFORMATION";
    String DEBUG_STR = "DEBUG";

    //日志级别的
    int FATAL = Integer.MIN_VALUE;
    int ERROR = 1;
    int WARNING = 2;
    int INFORMATION = 3;
    int DEBUG = 4;

    /**
     * 获取关联容器
     * @return
     */
    Container getContainer();

    /**
     * 设置容器
     * @param container
     */
    void setContainer(Container container);

    /**
     * 获取描述信息
     * @return
     */
    String getInfo();

    /**
     * 获取日志级别
     * @return
     */
    int getVerbosity();

    /**
     * 设置日志级别
     * @param verbosity
     */
    void setVerbosity(int verbosity);

    /**
     * 各种打印日志的重载方法
     */
    void log(String message);
    void log(Exception exception, String msg);
    void log(String message, Throwable throwable);

    /**
     * 指定级别打印  getVerbosity() <= verbosity 才会记录
     * @param message
     * @param verbosity
     */
    void log(String message, int verbosity);
    void log(String message, Throwable throwable, int verbosity);
}
